import 'package:mobx/mobx.dart';
/**
 * 1、pubspec.yaml的 dependencies增加 mobx、flutter_mobx、mobx_codegen；dev_dependencies增加build_runner
dependencies:
  mobx:
  flutter_mobx:
  mobx_codegen:

dev_dependencies:
  build_runner:

 * 2、写完MobxTest.dart下面代码之后需要启动生成器
在终端的该工程目录下通过下面的命令运行 build_runner 和 mobx_codegen后会自动生成MobxTest.g.dart文件

flutter packages pub run build_runner watch
*/
part 'mobx_test.g.dart';

class MobxTest = TestBase with _$MobxTest;

abstract class TestBase with Store {
  @observable
  int count = 0;

  @computed
  bool get hasAddTen => count > 10;

  @action
  void increnment() {
    count++;
  }
}
